<!DOCTYPE html>
<%@ page language="java" import="com.compuvest.web.*,com.compuvest.webstatus.*,java.text.*,java.util.*" pageEncoding="UTF-8" %>

<%@ taglib uri="/WEB-INF/tld/head.tld" prefix="head" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<fmt:setBundle basename="properties.Compuvest" var="cv" scope="page" />

<jsp:useBean id="sb" class="SQLBean" scope="application"/>
<jsp:useBean id="mail" class="Mail" scope="application"/>
<jsp:useBean id="basket" class="Basket" scope="session"/>
<%
    Customer cust = basket.getCustomer();
    if(cust == null) {
	response.sendRedirect(/*application.getInitParameter("https") +*/ "./ResellerForm.jsp");
	return;
    }

    SimpleDateFormat dateForm = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

    String mode = request.getParameter("mode");
    if(mode != null) {
	if("Send".equals(mode)) {
            sb.newReseller(cust, basket.getCompuvestCookies().getIPAddress());
            mail.sendReseller(cust);

            basket.setCustomer(null);

            response.sendRedirect("./" /*application.getInitParameter("http")*/);
            return;
	}
	else if("Edit".equals(mode)) {
            response.sendRedirect(/*application.getInitParameter("https") +*/ "./Reseller.jsp");
            return;
	}
    }
%>
<html>
<head>
<title><fmt:message key='webcorp' bundle='${cv}'/> Reseller Form Send</title>
<%@include file="./incl/scripts.txt" %>
</head>
<body style='background-color:white;'>

<div id='cvbody'>

 <head:show />

 <div id='cvcont'>
  <table id='cvmain'>
  <colgroup><col width='80px'/><col width='*'/><col width='80px'/></colgroup>
  <tbody>
   <tr>
    <td id='cvleft' valign="top">

    </td>
    <td id='cvcenter' align="center" valign="top">

<div class='cstyle'>
<fieldset style="text-align:center;">
<table>
 <tr>
 <td>
  <div style="background:#F5F5F5;"><img src='../img/hlogo.png' alt=""/></div>
  <div class='tit' style="text-align:center;"><fmt:message key='postaddress' bundle='${cv}'/>.</div>
  <div class='tit'>&nbsp;&nbsp;Tel: (425) 738-4091</div>
  <div class='tit'>&nbsp;&nbsp;Fax: (425)251-5000</div>
  <div class='tit' style="text-align:right;"><%= dateForm.format(new Date()) %>&nbsp;&nbsp;&nbsp;</div>
  <div class='tit'>&nbsp;&nbsp;Reseller Certificate # <font color='green'><%= cust.getResellerCode() %></font></div>
  <hr/>
 </td>
 </tr>
 <tr>
  <td>
  <div class='tit' style="padding:2px 6px;">Reseller Address:<br/>
   <span style="font-weight:normal;">
    <%= cust.getBilling().getCompany() %><br/>
    <%= cust.getBilling().getName() %><br/>
    <%= cust.getBilling().getAddress1() %>
    <%= cust.getBilling().getAddress2() %>
    <%= cust.getBilling().getCity() %>,
    <%= cust.getBilling().getState() %>
    <%= cust.getBilling().getZip() %>
    <%= cust.getBilling().getZip4() %>
    <%= cust.getBilling().getCountry() %><br/>
    Tel: <%= cust.getBilling().getPhone() %><br/>
    Cell: <%= cust.getBilling().getCell() %><br/>
    Fax: <%= cust.getBilling().getFax() %>
   </span>
  </div>
  </td>
 </tr>
 <tr>
  <td>
  <hr/>
  <div class='tit' style="font-weight:normal;padding:6px 6px;">
  &nbsp;&nbsp;&nbsp;Thank you for your interest in our reseller program.  Your application has been submitted and will be reviewed
  by one of our account managers.  We will be contacting you within 24 hours if any questions arise and will help you take full
  advantage of this program.  You will also be assigned a designated sales person to work directly with your company - ensuring
  everything is handled smoothly and accurately.
  </div>
  <hr/>
  <div style="text-align:right;">
   <form name='sendForm' action="<%= "./" /*application.getInitParameter("https")*/ %>"ResellerSendForm.jsp" method='POST'>
   <input type='submit' name='mode' value='Edit'/>&nbsp;&nbsp;
   <input type='submit' name='mode' value='Send'/>&nbsp;&nbsp;
   </form>
  </div>
  </td>
 </tr>
</table>

</fieldset>
</div>

    </td>
    <td id='cvright' valign="top">

    </td>
   </tr>
  </tbody>
  </table>
 </div>

 <div id='cvfoot'></div>
</div>

</body>
</html>
